# Maintainer: Martell Malone <martellmalone@gmail.com>

_realname=openbios
pkgname="${_realname}-git"
_ver_base=1.1
pkgver=1.1.1261.b95d533
pkgrel=1
pkgdesc="OpenBIOS"
arch=('i686' 'x86_64')
url="https://www.openbios.org/"
license=('GPL2')
makedepends=('git' 'gcc' 'make' 'fcode-utils')

source=("${_realname}"::"git+https://git.qemu.org/git/openbios.git"
        "0001-fix-printk-to-use-FMT-cell-instead-of-x-where-it-sho.patch")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd "$srcdir/$_realname"
  printf "%s.%s.%s" "$_ver_base" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}



prepare() {
  cd "$srcdir/$_realname"
  git am $srcdir/0001-fix-printk-to-use-FMT-cell-instead-of-x-where-it-sho.patch
  #patches here please :)
}

build() {
  cd $srcdir/${_realname}

  if [ "$CARCH" = "x86_64" ]
  then
    ./config/scripts/switch-arch amd64
  fi

  if [ "$CARCH" = "i686" ]
  then
    ./config/scripts/switch-arch x86
  fi

  make -j1
}

package() {
  cd $srcdir/${pkgname}
  mkdir -p ${pkgdir}/usr/bin

  //todo
}
